#! /bin/bash

case $1 in
"start"){
    for i in hadoop102 hadoop103 hadoop101
    do
        echo " --------启动 $i Kafka-------"
        ssh $i "/opt/bigdata/kafka_2.11-2.4.1/bin/kafka-server-start.sh -daemon /opt/bigdata/kafka_2.11-2.4.1/config/server.properties"
    done
};;
"stop"){
    for i in hadoop102 hadoop103 hadoop101
    do
        echo " --------停止 $i Kafka-------"
        ssh $i "/opt/bigdata/kafka_2.11-2.4.1/bin/kafka-server-stop.sh stop"
    done
};;
esac